﻿@model TrialControllerModel.History
<div class="page">
    <div class="pageHeader">
        <form id="pagerForm" onsubmit="return navTabSearch(this);" action="/game/trial/history"
        method="post">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>
                        游戏区服：
                    </label>
                    <select name="ServerId">
                        <option value="" @(Model.ServerId == 0 ? "selected=selected" : string.Empty)>请选择游戏区服</option>
                        @foreach (var o in Model.Games)
                        {
                            <optgroup label="@o.Name">
                                @foreach (var i in o.Servers)
                                { 
                                    <option value ="@(i.Id)" @(Model.ServerId == i.Id ? "selected=selected" : string.Empty)>@(o.Name)--
                                        @i.Name</option>
                                }
                            </optgroup>
                        }
                    </select>
                </li>
                <li>
                    <label>
                        用户Id：</label>
                    <input name="UserId" type="text" maxlength="8" value="@Model.UserId" />
                </li>
                <li>
                    <label>
                        等 级：</label>
                    <input name="Level" type="text" maxlength="2" value="@Model.Level" />
                </li>
                <li>
                    <label>
                        领取日期：
                    </label>
                    <input type="text" name="Date" value="@(Model.Date.ToString("yyyy-MM-dd", string.Empty))" class="date" readonly="readonly"/>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        </form>
    </div>
    <div>
        <div class="panelBar">
            <ul class="toolBar">
                <li><a class="add" href="/game/trial/detail?" ><span>导 出</span></a></li>
            </ul>
        </div>
        <table class="table" layouth="138" width="100%">
            <thead>
                <tr>
                    <th width="100">
                        用户Id
                    </th>
                    <th width="100">
                        等 级
                    </th>
                    <th>
                        获取积分
                    </th>
                    <th width="200">
                        游戏区服
                    </th>
                    <th width="160">
                        获取时间
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var o in Model.Histories)
                {
                    <tr target="param" rel="@o.Id">
                        <td>@o.UserId
                        </td>
                        <td>@o.Level
                        </td>
                        <td>@o.Integral
                        </td>
                        <td>@(Model.Servers.First(x => x.Id == o.ServerId).Game.Name + " -- " + Model.Servers.First(x => x.Id == o.ServerId).Name)
                        </td>
                        <td>
                            @o.CreatedOn.ToString("yyy-MM-dd HH:mm:ss")
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
